package com.example.demo.collection.hashset;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author luowenjie
 * @since 2021/9/14 17:11
 */
public class HashSetTest {

    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("a");
        list.add("a");
        list.add("b");
        list.add("c");
        Set<String> existOpenIdSet = new HashSet<String>(list);
        for(String s:list){
            System.out.println(s);
        }
        list.clear();
        for(String s:existOpenIdSet){
            System.out.println(s);
        }
        for(String s:list){
            System.out.println(s);
        }
    }

}
